//
//  ChildCell.m
//  XMLY
//
//  Created by lanou on 15/11/4.
//  Copyright © 2015年 曾杰. All rights reserved.
//

#import "ChildCell.h"
#import "UIImageView+WebCache.h"
@interface ChildCell ()
@property (weak, nonatomic) IBOutlet UIImageView *MyImageView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *descLabel;
@property (weak, nonatomic) IBOutlet UILabel *tingCount;
@property (weak, nonatomic) IBOutlet UILabel *tracksLabel;

@end


@implementation ChildCell
- (void)configureCellWithModel:(ChildDetailModel *)model{
    [self.MyImageView sd_setImageWithURL:[NSURL URLWithString:model.albumCoverUrl290]];
    self.titleLabel.text = model.title;
    self.descLabel.text = model.intro;
    self.tracksLabel.text = [NSString stringWithFormat:@"%.0f集", model.tracks] ;
    if (model.playsCounts >= 10000 && model.playsCounts < 100000000) {
        self.tingCount.text = [NSString stringWithFormat:@"%.1f万", model.playsCounts/ 10000] ;
    }else if (model.playsCounts >= 100000000){
        self.tingCount.text = [NSString stringWithFormat:@"%.1f亿", model.playsCounts/ 100000000] ;
    }else{
        self.tingCount.text = [NSString stringWithFormat:@"%f", model.playsCounts];
    }
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
